package com.gismore.demo

import com.gismore.demo.db.dao.CustomerRepository
import com.gismore.demo.db.domain.Customer
import org.springframework.boot.CommandLineRunner
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.context.annotation.Bean

@SpringBootApplication
open class Application{
    @Bean
    open fun init(repo: CustomerRepository) = CommandLineRunner {
        repo.save(Customer("Lei", "Zhao"))
        repo.save(Customer("Leo", "Chiu"))
    }
}

fun main(args: Array<String>) {
    SpringApplication.run(Application::class.java, *args)
}
